package com.wenhao.newcode.huawei;

import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-07-15 12:28
 */
public class MainHJ1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        boolean flag = true;
        int length = 0;
        for (int i = s.length() - 1;i > -1;i--) {
            if (s.charAt(i) == ' ') {
                if (flag) {
                    continue;
                } else {
                    break;
                }
            } else {
                length++;
                flag = false;
            }
            System.out.println(length);
        }
    }
}
